1. Field of the Invention
The present invention relates to a printing apparatus having a direct printing function, a method for controlling the printing apparatus, and a storage medium.
2. Description of the Related Art
“Direct printing” is known as one of the methods for printing Page Description Language (PDL) data on a sheet printing media by directly transmitting PDL data from a host computer to a suitable printer without using a print driver or an application to preprocess the PDL data. For example, a printable file is generated with an application on the host computer, and the file can be printed by specifying it as PDL data via a web browser or a user interface (UI) on the printer. In other words, direct printing refers to transmitting PDL data to a printer without the intervention of a printer driver. In many cases of direct printing, for example, electronic document formats such as Portable Document Format (PDF) and Extensible Markup Language (XML) Paper Specification (XPS:XML Paper Specification), and image formats such as Tagged Image File Format (TIFF) and Joint Photographic Experts Group (JPEG) are used. One of the greatest advantages of direct printing is that a PDL data file can be printed without opening the file with a dedicated application on the host computer.
However, a problem may arise if the PDL data at the time of printing is not optimized for a target printer from which the data is output. An electronic document format includes page size information such as a logical page size and output paper size information for each page. However, the logical page size specified in the electronic document format is not necessarily applicable to the target printer. As a method for solving this problem, a conventional technique is known for checking sizes of all pages before image formation to determine a reference medium size (for example, refer to Japanese Patent Application Laid-Open No. 2005-212124). Further, there is a technique for arranging page layout so that a page width and height fit into the same series paper larger than paper having a specified size, when alternative paper is used in the case where paper runs out (for example, refer to Japanese Patent Application Laid-Open No. 2008-260148). These techniques are known for optimizing the actually used paper (hereinafter referred to as output paper) according to a type of paper currently fed to the printer or types of paper supported by the printer.
Although data generated by combining data generated by using various types of software conforms to the electronic document format code, such PDL data may become unsuitable for direct printing.
For example, a case may be considered where the unit system of each application used to generate data is not unified causing a difference in a paper size. More specifically, suppose that a width (100 mm) of a postcard can be converted to 3.937007874015 . . . inches. However, when a printing application using non-metric units handles this value as a corrected value of 3.937 inches, the converted value is 99.9998 mm resulting in an error. In contrast, an application employing the International System of Units and handling a length in millimeters can handle the width of the postcard as 100 mm without an error. When a file includes a page containing a size error and a page without the error, the printer recognizes that a different page size is specified for each page.
When a specified page size in PDL data is close to a size of a fixed-size paper, suitable fixed-size paper is selected by ignoring a difference in size through error correction processing, thus obtaining an output which is close to a result desired by a user. However, when the specified size largely deviates from any size of the fixed-size paper, the printer cannot select suitable fixed-size paper since no reference paper size can be found. If a slight size difference has arisen between pages, a different sheet is selected for each page and therefore the user cannot obtain a desired output result. It is difficult therefore for the printer to automatically distinguish whether the slight size difference is caused by a calculation error or a size difference intended by a person in charge of printing. In this case, the printer will handle the PDL data assuming that unfixed-size paper to be used for printing with the page size is specified for each page.
As described above, if there is a slight error in handling of the page size, there is a problem that sufficient measures have not been taken for improving user convenience without sacrificing advantages of direct printing.
For example, two possible methods are assumed as ad-hoc solutions. A first method is to correct PDL data with an application, and a second method is to change print settings and ignore print settings in the PDL data. With the first method, the problem can be prevented from occurring by correcting page size information in the PDL data. However, one of the advantages of direct printing is simplicity, i.e., that data can be printed without opening a relevant file with an application. Therefore, opening a file with an application for correcting the page size of a document defeats the purpose and the advantages of direct printing. Furthermore, in some cases, PDL data has undergone encryption processing and therefore cannot be edited because of a function to prevent data alteration. With the second method, the user specifies the size of the output paper at the time of printing and therefore the page size information in the PDL data is ignored. In this case, since a paper size specified separately from the PDL data will be reflected even to pages having no problem, there may be a situation that an undesirable output or an unexpected result may arise in the case of a file including a plurality of paper sizes.